﻿using System;
using System.Collections.Generic;
using Leo.Awesome.AppPlatform.Enums;
using Leo.Awesome.AppPlatform.ValueObjects;

using Leo.Core.Common;
using Volo.Abp.Application.Dtos;

namespace Leo.Awesome.AppPlatform.Dtos
{
    public class MenuTreeOutput : EntityDto<Guid>, ITreeItem<MenuTreeOutput>
    {
        /// <summary>
        /// 菜单名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 唯一标识
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// Path路径
        /// </summary>
        public string PathCode { get; set; }

        /// <summary>
        /// 权限标识
        /// </summary>
        public string Permission { get; set; }

        /// <summary>
        /// 类型：目录、菜单项
        /// </summary>
        public MenuType MenuType { get; set; }

        /// <summary>
        /// 上级菜单
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Order { get; set; }

        /// <summary>
        ///      是否显示 默认true
        /// </summary>
        public bool Display { get; set; } = true;

        /// <summary>
        /// 打开方式:弹框、当前窗口、新窗口
        /// </summary>
        public OpenMethod? OpenMethod { get; set; }

        /// <summary>
        ///     路由地址
        /// </summary>
        public string RouterPath { get; set; }

        /// <summary>
        ///     路由名称
        /// </summary>
        public string RouterName { get; set; }

        /// <summary>
        ///     前端组件路径
        /// </summary>
        public string RouterComponent { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// URL地址
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 是否是面包屑
        /// </summary>
        public bool? IsCrumbs { get; set; }

        /// <summary>
        /// 菜单元
        /// </summary>
        public MenuMeta Meta { get; set; }

        public List<MenuTreeOutput> Children { get; set; } = new();

        public bool HasChildren { get; set; }
    }
}
